package com.chuyu.cy.config;

import com.chuyu.cy.ws.SocketToChat;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @author: white-zhou
 * @date: 2024-03-26 21:03
 * WebSocket配置类
 **/
@Configuration
public class WebSocketConfig {

    // websocket配置类
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        ServerEndpointExporter exporter = new ServerEndpointExporter();
        exporter.setAnnotatedEndpointClasses(SocketToChat.class);
        return exporter;
    }

}
